package org.reenscape.skill;
import org.reenscape.model.*;
import org.reenscape.updater.*;
public class Thieving {

				public void Pickpocket(int Npc, PacketParser p3, int NpcSlot){ //Switches
					switch(Npc){
						case 1: //MAN
						case 2:
						case 3:
						Pickpocket_main(NpcSlot, Npc, p3, "man", 1, 4, 5, 1);
						break;
		
						case 4: //WOMAN
						case 5:
						case 6:
						Pickpocket_main(NpcSlot, Npc, p3, "woman", 1, 4, 5, 1);
						break;
		
						case 9: //GUARDS
						case 10:
						case 32:
						case 334:
						case 335:
						case 336:
						case 368:
						case 678:
						case 682:
						case 887:
						Pickpocket_main(NpcSlot, Npc, p3, "guard", 40, 23.5, 5, 2);
						break;
		
						case 7: //FARMER
						Pickpocket_main(NpcSlot, Npc, p3, "farmer", 10, 7.5, 5, 1);
						break;
		
						case 1714: //MALE HAM MEMBER
						case 1715:
						Pickpocket_main(NpcSlot, Npc, p3, "male H.A.M member", 20, 11, 6, 2);
						break;
		
						case 1716: //FEMALE HAM MEMBER
						case 1717:
						Pickpocket_main(NpcSlot, Npc, p3, "female H.A.M member", 15, 9, 6, 2);
						break;
		
						case 15: //WARRIOR WOMAN
						Pickpocket_main(NpcSlot, Npc, p3, "warrior woman", 25, 13, 5, 2);
						break;
		
						case 18: //WARRIOR [MALE]
						case 1318:
						Pickpocket_main(NpcSlot, Npc, p3, "warrior", 25, 13, 5, 2);
						break;
		
						case 2234: //MASTER FARMER
						case 2235:
						Pickpocket_main(NpcSlot, Npc, p3, "master farmer", 38, 21.5, 5, 3);
						break;
		
						case 187: //ROGUE
						Pickpocket_main(NpcSlot, Npc, p3, "rogue", 32, 18, 5, 2);
						break;
		
						case 660: //KNIGHT
						Pickpocket_main(NpcSlot, Npc, p3, "knight", 55, 42.5, 5, 3);
						break;
		
						case 21: //HERO
						Pickpocket_main(NpcSlot, Npc, p3, "hero", 80, 137.5, 6, 4);
						break;
		
						default: //Ignored
						break;
					}
				}
				
				public void Pickpocket_main(int NpcSlot, int Npc, PacketParser p3, String type, int Req, double XP, int FailHold, int FailHit){
						if(/*p3.LogoutDelay < 0*/true){	
							if(p3.playerLevel[p3.playerThieving] >= Req){
								int Percent =  25 + (p3.playerLevel[p3.playerThieving] - Req);
								int Chance = (int) (java.lang.Math.random() * 100);
  
								if (Chance <= Percent) { 
									p3.sendMessage("You pick the "+type+"'s pocket.");
									p3.Animation(881);
									p3.addSkillXP(XP, Skill.THIEVING);
									Pickpocket_Reward(type, p3);
								}
								else {
									int Val = (int) (java.lang.Math.random() * 2);
									p3.sendMessage("You fail to pick the "+type+"'s pocket.");
									if(Val == 1){
										NpcUpdater.npcs[NpcSlot].RandomWalk = false;
										NpcUpdater.NpcTalk(NpcSlot, "What do you think you're doing?", true);
										NpcUpdater.npcs[NpcSlot].RotateToPoint(p3.absX, p3.absY);
										NpcUpdater.ForceAnimation(NpcSlot, 422);
										NpcUpdater.ResetAttackPlayer(NpcSlot);
										p3.sendMessage("You have been stunned!");
										Graphics.StillGFX(p3.absX, p3.absY, 80, p3.heightLevel);
										p3.Animation(424);
										p3.StunnedTimer = (FailHold * 2);
										p3.resetWalkingQueue();
										p3.hitDiff = FailHit;
										p3.updateRequired = true;
										p3.hitUpdateRequired = true;
										p3.appearanceUpdateRequired = true;
									}
								}
							} else {
								p3.sendMessage("You need a thieving level of "+Req+" to do this."); 
							}
						}   else {
							p3.sendMessage("You can't pickpocket during combat.");
						}
				}
				
				public void Pickpocket_Reward(String tt, PacketParser p3){
					if(tt.startsWith("man") || tt.startsWith("woman")){
						p3.addItem(995, 3);
					}
					else if(tt.startsWith("guard")){
						p3.addItem(995, 30);
					}
					else if(tt.startsWith("farmer")){
						int Val = (int)(java.lang.Math.random() * 2);
						if(Val == 0) p3.addItem(995, 9);
						if(Val == 1) p3.addItem(5319, 1);
						if(Val == 2) p3.addItem(5318, 1);
					}
					else if(tt.startsWith("warrior")){
						p3.addItem(995, 18);
					}
					else if(tt.startsWith("hero")){
						int Val = (int) (java.lang.Math.random() * 6);
						if(Val == 0) p3.addItem(995, 100);
						if(Val == 1) p3.addItem(569, 1);
						if(Val == 2) p3.addItem(1993, 1);
						if(Val == 3) p3.addItem(560, 2);
						if(Val == 4) p3.addItem(565, 1);
						if(Val == 5) p3.addItem(680, 1);
						if(Val == 6) p3.addItem(1601, 1);
					}
				}
}